<template>
  <el-row>
    <el-col class="fs-3 text-center" style="background-color:#bae7ff">推荐新闻</el-col>
    <el-col  class="mx-auto"> 
      <ol> 
        <li v-for="news in newsadd" :key="news.newsTitle" class="mx-auto">         
          
         <router-link :to="{ path: '/detail/'}">
           {{ news.newsTitle }}  
        </router-link> 
        </li>
      </ol>
    </el-col>
  </el-row>
</template>

<script>
export default {
  name: "NewsAdd",
  components: {
  
  },
  data() {
    return {
      newsadd: [],
    };
  },
  mounted() {
    this.getNewsadd();
  },
   watch:{
    newsName(){
      console.log(this.newsName)
      this.getNewsadd();
    },
  },
  methods: {
    getNewsadd() {
     this.$axios.get('/api/home/rank')
     .then(response=>{this.newsadd = response.data})
    },
  },
};
</script>

<style>

</style>